import { Controller } from 'egg';
import { ContractsEditRemarkIn } from '../dto/in/contactsIn';
import { ContractsListOut } from '../dto/out/contactsOut';
import ApiDecorator from '../src/decorator/apiDecorator';
import ResultUtil from '../src/util/resultUtil';

@ApiDecorator.Controller("/contacts", "联系人模块")
export default class ContactsController extends Controller {


    /**获取联系人 */
    @ApiDecorator.GET("/list", "获取所有好友", { out: ContractsListOut })
    public async getContactsList() {
        this.ctx.body = ResultUtil.success(await this.service.contacts.getContactsList());
    }

    /**修改备注 */
    @ApiDecorator.PUT("/remark", "修改备注", { in: ContractsEditRemarkIn })
    public async editRemark(params: ContractsEditRemarkIn) {
        await this.service.contacts.editRemark(params);
        this.ctx.body = ResultUtil.successMsg();
    }

    // /**查找联系人 */
    // @ApiDecorator.POST("/search", "查找用户", { in: ContactsSearchIn })
    // public async search(params: ContactsSearchIn) {

    // }


}